package model

type Property struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

func (p Property) IsValid() bool {
	return len(p.Key) > 0 && len(p.Value) > 0
}

type AuthInfo struct {
	Type     string `json:"type"`
	Username string `json:"username"`
	Password string `json:"password"`
}

type RequestInfo struct {
	RequestUrl       string     `json:"requestUrl"`
	RequestMethod    string     `json:"requestMethod"`
	RequestHeader    []Property `json:"requestHeader"`
	RequestPathParam []Property `json:"requestPathParam"`
	RequestParam     []Property `json:"requestParam"`
	RequestType      string     `json:"requestType"`
	RequestBody      string     `json:"requestBody"`
	RequestForm      []Property `json:"requestForm"`
	AuthInfo         AuthInfo   `json:"auth"`
	BeforeScript     string     `json:"beforeScript"`
	AfterScript      string     `json:"afterScript"`
}

type ResponseInfo struct {
	ResponseHeader []Property `json:"responseHeader"`
	ResponseCode   int        `json:"responseCode"`
	ResponseBody   string     `json:"responseBody"`
}
